package com.github.jiangxch.rpc.transport.exchanger.jdk;

import com.github.jiangxch.rpc.transport.Server;
import com.github.jiangxch.rpc.transport.exchanger.ExchangeServer;

import java.net.InetSocketAddress;

/**
 * @author: jiangxch
 * @date: 2021/2/26 上午1:52
 */
public class JdkExchangeServer implements ExchangeServer {
    private Server server;
    
    public JdkExchangeServer(Server server) {
        this.server = server;
    }
    
    @Override
    public InetSocketAddress getLocalSocketAddress() {
        return server.getLocalSocketAddress();
    }
    
    @Override
    public void start() {
        server.start();
    }
    
    @Override
    public void close() {
        server.close();
    }
    
    @Override
    public boolean isClosed() {
        return server.isClosed();
    }
}
